package com.zhmsky.controller;

import com.zhmsky.VO.InstockInfoVO;
import com.zhmsky.mapper.InstockInfoMapper;
import com.zhmsky.model.ResultMap;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhmsky
 * @date 2021/12/9 22:52
 */
@RestController
@RequestMapping("/InstockInfo")
public class InstockInfoController {
    @Autowired
    private InstockInfoMapper instockInfoMapper;
    @Autowired
    private ResultMap resultMap;

    /**
     * @description 查询入库单详细信息(明细)
     * @return
     */
    @GetMapping("/getInstockInfo")
    @RequiresRoles(logical = Logical.OR,value = {"admin","user"})
    public ResultMap getInstockInfo(){
        List<InstockInfoVO> instockInfo = instockInfoMapper.getInstockInfo();
        return resultMap.success().code(200).message(instockInfo);
    }
}
